package com.mixsmart.web.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import com.mixsmart.web.msgpush.MessageType;
import com.mixsmart.web.msgpush.impl.SendMsgFactory;

@Controller
@RequestMapping("/test")
public class TestController extends BaseWebController {

	private static final String VIEW_DIR = WEB_BASE_VIEW_DIR+"/test/";
	
	@RequestMapping("/comet4j.do")
	public ModelAndView comet4j() {
		ModelAndView modelView = new ModelAndView();
		SendMsgFactory.getInstatnce().getSendMessage().sendAll("嘿嘿");
		modelView.setViewName(VIEW_DIR+"comet4j");
		return modelView;
	}
	
	@RequestMapping("/send.do")
	@ResponseBody
	public Object send() {
		SendMsgFactory.getInstatnce().getSendMessage().sendAll("测试发送内容中。。。");
		//SendMsgFactory.getInstatnce().getSendMessage().send(MessageType.MESSAGE, "48f0b36b7cca4c13b9c2c22edb2f32f9", "测试发给指定用户");
		return "none";
	}
	
}
